package com.py.credit.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.EvalInfo;
import com.py.credit.entity.IndexCatModel;
import com.py.credit.entity.Model;
import com.py.framework.core.common.Page;

public interface EvalInfoDao {
	List<Model> getListForPage(@Param(value = "sortType") String sortType, @Param(value = "page") Page page);

	/**
	 * 获取列表
	 * 
	 * @return
	 */
	public List<Map<String, Object>> selectByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "shzt") String shzt);

	/**
	 * 添加模型
	 * 
	 * @param ruleName
	 * @param ruleDesc
	 * @param rulePackage
	 * @param ruleMethod
	 * @param time
	 * @param managerId
	 */
	void insert(@Param(value = "id") String id, @Param(value = "name") String name, @Param(value = "desc") String desc,
			@Param(value = "scoreType") String scoreType, @Param(value = "zone") String zone,
			@Param(value = "industry") String industry, @Param(value = "reportType") String reportType,
			@Param(value = "templateType") String templateType, @Param(value = "checkType") String checkType,
			@Param(value = "checkProcess") String checkProcess);

	/**
	 * 修改模型
	 * 
	 * @param ruleName
	 * @param ruleDesc
	 * @param rulePackage
	 * @param ruleMethod
	 * @param time
	 * @param managerId
	 */
	void update(@Param(value = "id") String id, @Param(value = "name") String name, @Param(value = "desc") String desc,
			@Param(value = "scoreType") String scoreType, @Param(value = "zone") String zone,
			@Param(value = "industry") String industry, @Param(value = "reportType") String reportType,
			@Param(value = "templateType") String templateType, @Param(value = "checkType") String checkType,
			@Param(value = "checkProcess") String checkProcess);

	EvalInfo selectOne(@Param(value = "id") String id);

	public List<Map> getRelatedCategoryAndIndexValuesByModelId(@Param(value = "userId") String userId,
			@Param(value = "modelId") String modelId);

	void changeStatus(@Param(value = "newStatus") String newStatus, @Param(value = "shsj") Date shsj,
			@Param(value = "shr") String shr, @Param(value = "id") String id,
			@Param(value = "processId") String processId);

	void evalProcess(@Param(value = "processId") String processId, @Param(value = "oldStatus") String oldStatus,
			@Param(value = "newStatus") String newStatus, @Param(value = "shr") String shr,
			@Param(value = "shsj") Date shsj, @Param(value = "shyj") String shyj,
			@Param(value = "evalId") String evalId);

	void returnIndexes(@Param(value = "list") List list, @Param(value = "processId") String processId);

	public List<IndexCatModel> getAllIndexAndValuesAndRules(@Param(value = "evalId") String evalId);

	public List<IndexCatModel> getAllIndexAndValuesForZz(@Param(value = "evalId") String evalId);

	public List<IndexCatModel> getAllIndexAndValuesAndRulesForZz(@Param(value = "evalId") String evalId);

	public List<Map> viewCheck(@Param(value = "modelId") String modelId, @Param(value = "userId") String userId,
			@Param(value = "evalId") String evalId);

	public void deleteScoreByIndex(@Param(value = "deleteScoreByIndex") String deleteScoreByIndex,
			@Param(value = "userId") String userId);

	public void initScoreByIndex(@Param(value = "deleteScoreByIndex") String deleteScoreByIndex,
			@Param(value = "userId") String userId, @Param(value = "value") String value,
			@Param(value = "id") String id);

	public void updateModelIndexValue(@Param(value = "evalId") String evalId,
			@Param(value = "indexCatModelId") String indexCatModelId, @Param(value = "userId") String userId,
			@Param(value = "value") String value, @Param(value = "cjr") String cjr);

	public void deleteModelIndexValue(@Param(value = "evalId") String evalId,
			@Param(value = "indexCatModelId") String indexCatModelId, @Param(value = "userId") String userId);

	public void updateModelIndexScore(@Param(value = "indexCatModelId") String indexCatModelId,
			@Param(value = "userId") String userId, @Param(value = "value") String value);

	public void deleteModelIndexScore(@Param(value = "indexCatModelId") String indexCatModelId,
			@Param(value = "evalId") String evalId);

	public void saveModelIndexScore(@Param(value = "indexCatModelId") String indexCatModelId,
			@Param(value = "modelId") String modelId, @Param(value = "userId") String userId,
			@Param(value = "value") String value);

	public void preScore(@Param(value = "listIndexes") List<IndexCatModel> listIndexes,
			@Param(value = "userId") String userId, @Param(value = "modelId") String modelId,
			@Param(value = "evalId") String evalId);

	public String getModelScoreRank(@Param(value = "modelId") String modelId, @Param(value = "score") String score);

	public List<Map> getScoreRank(@Param(value = "score") Double score, @Param(value = "modelId") String modelId);

	public EvalInfo getNewEvalInfo(@Param(value = "userId") String userId);

	public String getCheckProcessByEval(@Param(value = "id") String id);

	public String getCheckProcessByModel(@Param(value = "id") String id);

	public Map<String, Object> getTotalScore(@Param(value = "evalId") String evalId);

	public double getExtraScore(@Param(value = "evalId") String evalId, @Param(value = "extra") String extra);

	public List<Map<String, Object>> getProcessList(@Param(value = "id") String id);

	public void deleteScoreByModelAndUser(@Param(value = "modelId") String modelId,
			@Param(value = "evalId") String evalId);

	public void updateEvalScoreAndRank(@Param(value = "id") String id, @Param(value = "score") Double score,
			@Param(value = "scoreRank") String scoreRank, @Param(value = "evalInfo") String evalInfo);

	public List<Map> getIndexScoreList(@Param(value = "evalId") String evalId, @Param(value = "type") String type);

	public List<IndexCatModel> getIndexCategoryModel(@Param(value = "indexOrCatId") String indexOrCatId,
			@Param(value = "modelId") String modelId);

	public List<IndexCatModel> getIndexCategoryModelScore(@Param(value = "indexOrCatId") String indexOrCatId,
			@Param(value = "modelId") String modelId, @Param(value = "evalId") String evalId);

	public String getEvalIdByModelAndUser(@Param(value = "modelId") String modelId, @Param(value = "sqr") String sqr);

	public String updateIndexCategoryModel(@Param(value = "modelId") Double score,
			@Param(value = "indexOrCatId") String indexOrCatId, @Param(value = "modelId") String modelId);

	public IndexCatModel getIndexCategoryModelById(@Param(value = "id") String id,
			@Param(value = "evalId") String evalId);

	public List<Map<String, String>> selectModelList(@Param(value = "orgName") String orgName);

	int selectAccountNum(@Param(value = "orgId") String orgId);

	int selectPassedCheckNum(@Param(value = "orgId") String orgId);

	int selectProcessCheckNum(@Param(value = "orgId") String orgId);

	String selectBgbh(@Param(value = "id") String id);

	List<Map<String, Object>> selectAccountGraphicStats(@Param(value = "orgId") String orgId,
			@Param(value = "startDate") String start, @Param(value = "endDate") String end);

	List<Map<String, Object>> selectCheckingGraphicStats(@Param(value = "orgId") String orgId,
			@Param(value = "startDate") String start, @Param(value = "endDate") String end);

	List<Map<String, Object>> selectCheckedGraphicStats(@Param(value = "orgId") String orgId,
			@Param(value = "startDate") String start, @Param(value = "endDate") String end);

	List<Map<String, String>> setEvalInfoByOrgId(@Param(value = "orgId") String orgId);

}